package com.fanco.learn_datastruct_leetcode.designpattern.decorator;

/**
 * @author qiaowang 2022/2/14
 * 描述
 */
public class Client {
    public static void main(String[] args) {
        // 通过装饰者模式 下一份 2巧克力 + 1牛奶 的 LongBlack

        Drink order = new LongBlack();
        System.out.println(order.cost());

        // 2.加入一份牛奶
        order = new Milk(order);
        System.out.println("加入一份牛奶cost"+ order.cost());

        order = new Chocolate(order);
        System.out.println("加入一份巧克力cost" + order.cost());

        order = new Chocolate(order);
        System.out.println("加入一份巧克力cost" + order.cost());
    }
}
